import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import History from '../views/History.vue'
import schoolDate from '../views/schoolDate.vue'
import schoolHappy from '../views/schoolHappy.vue'
import schoolPicture from '../views/schoolPicture.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    children:[
      {
        path:'/History',
        name:'History',
        component:History
      },
      {
        path:'/schoolDate',
        name:'schoolDate',
        component:schoolDate
      },
      {
        path:'/schoolHappy',
        name:'schoolHappy',
        component:schoolHappy
      },
      {
        path:'/schoolPicture',
        name:'schoolPicture',
        component:schoolPicture
      },
    ]
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path:'/login',
    name:'login',
    component:Login
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
